package com.lst.api.vo;

import org.apache.commons.lang3.StringUtils;

import com.lst.api.entity.OrderContract;
import com.lst.api.exception.RequestParamErrorException;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: xibiao
 * @date: 2020/02/09
 * @version: V1.0
 */
@Data
@NoArgsConstructor
//todo 建议不要直接继承实体bean，接口文档显示控制麻烦
public class OrderContractVo extends OrderContract {

	@ApiModelProperty(name = "loanTypeIds", value = "贷款类型id字符串", required = true, dataType = "String")
    private String loanTypeIds;
	
	public void check() {
        boolean check = this.getProductId()!=null && this.getProductId()>0
        				&& StringUtils.isNotBlank(this.getApplyNo())
        				&& StringUtils.isNotBlank(this.getLoanTypeIds())
        				&& StringUtils.isNotBlank(this.getSignUrl())
        				&& StringUtils.isNotBlank(this.getPhotoUrls())
        				&& this.getServiceFee()!=null
        				&& this.getGuaranteeFee()!=null
        				&& this.getAccountManagementFee()!=null
        				&& this.getRiskGuaranteeFee()!=null
        				&& this.getChannelAgentFee()!=null
        				&& this.getInvoiceRate()!=null
        				&& this.getInformationFee()!=null
        				&& this.getAdvanceFee()!=null
        				&& this.getPrepaymentFee()!=null
        				&& this.getMortgageRegistrationQueryFee()!=null
        				&& this.getMortgageEmergencyFee()!=null
        				&& this.getReceiveAdvanceMoney()!=null;
        if (!check) {
            throw new RequestParamErrorException("OrderContractVo请求参数不合法！");
        }
    }
	
}
